Skip to content

MENDELU/Backport: Fix home-page SSR->CSR flicker#1315

Open
jr-rk wants to merge 3 commits into
customer/mendelufrom
mendelu/fe-fix-home-page-flicker
Open

MENDELU/Backport: Fix home-page SSR->CSR flicker#1315
jr-rk wants to merge 3 commits into
customer/mendelufrom
mendelu/fe-fix-home-page-flicker

Conversation

@jr-rk

@jr-rk jr-rk commented Jun 17, 2026

Copy link
Copy Markdown

Problem description

Backport from #1287

  • specific v9 adjustmens were needed
  • white page flickering is removed, but slight movement flicker is still present

Before:
mendelu-flickering-before
After:
mendelu-fixed-flickering

Analysis

(Write here, if there is needed describe some specific problem. Erase it, when it is not needed.)

Problems

(Write here, if some unexpected problems occur during solving issues. Erase it, when it is not needed.)

Sync verification

If en.json5 or cs.json5 translation files were updated:

  • Run yarn run sync-i18n -t src/assets/i18n/cs.json5 -i to synchronize messages, and changes are included in this PR.

Manual Testing (if applicable)

Copilot review

  • Requested review from Copilot

@jr-rk jr-rk self-assigned this Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f2698615-1e3b-4943-a13f-646493aecf0a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backports an SSR→CSR anti-flicker strategy for the /home page by rendering a “freeze-frame” overlay during bootstrap and removing it once Angular reports the app is stable, reducing the visible flash during client takeover.

Changes:

  • Add an inline bootstrap overlay script + CSS in index.html that clones the SSR-rendered <ds-app> into a fixed overlay and exposes window.__dspaceRemoveSsrOverlay().
  • Invoke overlay removal from AppComponent once ApplicationRef.isStable first becomes true (with a short rAF + delay pad).
  • Add typings for the window global and unit tests covering the stable-state removal behavior.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/index.html Adds overlay styles and inline script to clone SSR DOM and later fade/remove it.
src/app/app.component.ts Removes overlay after first stable state using ApplicationRef.isStable outside Angular.
src/app/app.component.spec.ts Adds tests verifying overlay removal and no-op behavior when global isn’t present.
src/typings.d.ts Declares the window.__dspaceRemoveSsrOverlay global for TypeScript.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app/app.component.spec.ts
Comment thread src/index.html

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

Comment thread src/index.html
Comment thread src/app/app.component.spec.ts
jr-rk and others added 2 commits June 18, 2026 16:53
Make the ApplicationRef.isStable override in the removeSsrOverlayWhenStable
suite configurable and restore the original descriptor in afterEach, so the
patched observable can't leak onto the shared TestBed instance. Add a test
for the requestAnimationFrame-absent fallback branch of the remover.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The overlay holds a deep clone of the SSR DOM purely as a freeze-frame. It
was aria-hidden and pointer-events:none, but Tab focus could still land on
the dead cloned controls. Add the inert attribute to take it out of the tab
order while it exists.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants